package com.easypan.Service;


import com.easypan.entity.dto.SessionShareDto;
import com.easypan.entity.dto.SessionwebUserDto;
import com.easypan.entity.po.FileInfo;
import com.easypan.entity.query.FileInfoQuery;
import com.easypan.entity.vo.PaginationResultVO;
import com.easypan.entity.vo.R;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.UnsupportedEncodingException;
import java.util.List;

/**
 * 文件信息 业务接口
 */
public interface FileInfoService {

    R changeFileFolder(String fileIds, String filePid, SessionwebUserDto webUserDto);

    /**
     * 根据条件查询列表
     */
    List<FileInfo> findListByParam(FileInfoQuery param);

    /**
     * 根据条件查询列表
     */
    Integer findCountByParam(FileInfoQuery param);

    /**
     * 分页查询
     */
    PaginationResultVO<FileInfo> findListByPage(FileInfoQuery param);

    /**
     * 新增
     */
    Integer add(FileInfo bean);

    /**
     * 批量新增
     */
    Integer addBatch(List<FileInfo> listBean);

    /**
     * 批量新增/修改
     */
    Integer addOrUpdateBatch(List<FileInfo> listBean);

    /**
     * 根据FileIdAndUserId查询对象
     */
    FileInfo getFileInfoByFileIdAndUserId(String fileId, String userId);


    /**
     * 根据FileIdAndUserId修改
     */
    Integer updateFileInfoByFileIdAndUserId(FileInfo bean, String fileId, String userId);


    /**
     * 根据FileIdAndUserId删除
     */
    Integer deleteFileInfoByFileIdAndUserId(String fileId, String userId);


    R updat(SessionwebUserDto sessionKey, String fileId, MultipartFile file, String fileName, String filePid, String fileMd5, Integer chunkIndex, Integer chunks, HttpSession session);

    R newFoloder(HttpSession session, String filePid, String fileName);

    R rename(SessionwebUserDto webUserDto, String fileId, String fileName);

    R loadAllFolder(SessionwebUserDto webUserDto, String filePid, String currentFileIds);

    R createDownloadUrl(String fileId, SessionwebUserDto webUserDto);
    R createDownloadUrl(String fileId, String userid);



    R download(HttpServletRequest request, HttpServletResponse response, String code) throws UnsupportedEncodingException;

    R delFile(SessionwebUserDto webUserDto, String fileIds);

    R loadRecycleList(SessionwebUserDto webUserDto, String pageNo, String pageSize);

    R saveShare(String fileId, String shareFileIds, String myFolderId, String shareUserId, int userId);
}